package com.dubbo.consumer.web;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.demo.DemoService;

@RestController
public class HelloController {

    @Autowired
    private DemoService demoService;
// http://192.168.100.47:8080/dubbo-consumer-web/hello.html?num=10
    @RequestMapping("/hello.html")
    @ResponseBody
    public String sayHello(Long num) {
        List<String> welcome = demoService.getPermissions(num);
        return welcome.get(1);
    }
}